package com.example.factory.factory.demo2;

import com.example.factory.factory.demo2.factory.MengniuFactory;
import com.example.factory.factory.demo2.factory.MilkFactory;
import com.example.factory.factory.demo2.factory.TelunsuFactory;

/**
 * 工厂模式 测试类
 * @author zhoubin
 * @date 2019-10-17 17:48:53
 */
public class FactoryTest {
    public static void main(String[] args) {

        /*
         * AbstractMilkFactory  工厂
         * MengniuFactory 具体生产的工厂
         * createMilk() 生产具体品牌的牛奶
         */
        MilkFactory mengniu = new MengniuFactory();
        System.out.println(mengniu.createMilk("115"));;


        MilkFactory telunsu = new TelunsuFactory();
        System.out.println(telunsu.createMilk("120"));;

    }
}
